
<style lang="scss" scoped>
    @import '../../css/training.scss';
    @import '../../css/exam2.scss';
    .show-answer-txt{cursor: pointer;}
    .exam-ones{border:none;width: 100%;}
</style>

<template>
    <section>

        <section class="exam-preview-box">
                    <ul class="exam-preview">

                        <li class="p-relative mt preview-content">
                            <p class="pb20 pt20 train-name">{{QNRForm.ExamTitle}}</p>
                            <p class="ml20">{{QNRForm.ExamDesc}}</p>

                            <!-- 开始题目循环 -->
                            <template v-for="outer,index in QNRForm.Questions">   <!-- QuestionType:1, 多选题  2，单选题 3，问答 -->
                                <!-- 单选题+多选题 -->
                                <!-- &lt;!&ndash; 显示状态 &ndash;&gt;-->
                                <section>  <!-- 显示状态 -->
                                    <div class="exam-one clearfix mt20 exam-ones" v-if="outer.QuestionType!=3">
                                        <div class="examo-lef">
                                            <div class="">Q{{index+1}}</div>
                                        </div>
                                        <div class="examo-rig">
                                            <!-- 标题 -->
                                            <div class="examo-tit examo-line  clearfix">
                                                <div class="examo-f01">
                                                    <span v-if="outer.QuestionType==1">【多选题】</span>
                                                    <span v-else>【单选题】</span>

                                                    <span class="">{{outer.QuestionTitle}}</span>
                                                </div>
                                                <!--<div class="examo-f02">-->
                                                <!--<span>{{outer.RightScore}}</span>-->
                                                <!--<span>分</span>-->
                                                <!--</div>-->
                                            </div>
                                            <!-- 选项 -->

                                            <!--答案隐藏状态-->

                                            <div class="examo-one examo-line mt20 clearfix" v-for="one,iIndex in outer.Answers">
                                                <div class="examo-f00">
                                                    <!--<el-radio v-model.number="outer.RightAnswerIndexs" :label="iIndex" v-if="outer.QuestionType==2">{{answerArr[iIndex]}}</el-radio>-->
                                                    <el-radio :label="iIndex" v-if="outer.QuestionType==2">{{answerArr[iIndex]}}</el-radio>

                                                    <label v-else>
                                                        <span class="exam-checkbox"></span>
                                                    </label>
                                                    <span>{{one.AnswerValue}}</span>
                                                </div>
                                            </div>






                                        </div>
                                    </div>
                                    <!-- 问答题 -->
                                    <div class="exam-one clearfix mt20" v-else>
                                        <div class="examo-lef">
                                            <div class="">Q{{index+1}}</div>
                                        </div>
                                        <div class="examo-rig">

                                            <div class="examo-one examo-line clearfix">
                                                <div class="examo-f00">
                                                    <!--<el-input class="examo-inp00" placeholder="标题"></el-input>-->
                                                    {{outer.QuestionTitle}}
                                                </div>
                                                <div class="examo-f01">
                                                    <span>【问答题】</span>
                                                </div>
                                                <!--<div class="examo-f02">-->
                                                <!--<span>{{outer.RightScore}}</span>-->
                                                <!--<span>分</span>-->
                                                <!--</div>-->
                                            </div>
                                            <div class="mt20">
                                                <!--{{outer.Answers[0].AnswerValue}}-->
                                                <!--<el-input type="textarea" :rows="5" placeholder="请输入问答答案...">
                                                </el-input>-->
                                            </div>
                                        </div>
                                    </div>

                                </section>

                            </template>





                        </li>

                    </ul>

                </section>

    </section>
</template>

<script>

	import qs from 'qs'

	let answerArr = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'G', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];


	export default{
		data: function(){
			return {
				examAnswerShow: true,
				examAnswerHide: false,

				QNRForm:{
					ExamTitle:'',
					ExamDesc:'',
					PassScore:'',
					AllowCostTime:'',
					InfoCateID:'',
					CateName:'',
					Questions: [] ,
				},

				answerArr:answerArr,

			}
		},
		mixins: [mixinMethods],
		methods: {
			initGetQNRExamInfo(){
				let ExamQNRID = this.$route.query.ExamQNRID;
				if(ExamQNRID == undefined || !ExamQNRID){
					let form = localStorage.getItem("QNRformInfo");
					let form1 = JSON.parse(form);
					this.QNRForm =form1.form;
				}else if(ExamQNRID) {
					if (ExamQNRID > 0) {
						axios.post('/com/exam/getQNRLib', qs.stringify({  // 库问卷详情
							examLibID: ExamQNRID
						})).then((res) => {
							var d = res.data;

							if (d.flag == 1) {
								d = d.data;

								this.QNRForm = d;
								this.QNRForm.ExamLibID = ExamQNRID;
							} else {
								this.$message.error(d.msg);
							}
						});
					}
				}

			},



		},
		mounted: function(){
			this.initGetQNRExamInfo();

		}
	}


</script>
